import http from '../utils/request'

// 请求首页数据
export const getData = () => {
    // 返回一个promise对象
    return http.get('/home/getData')
}

export const getUser = (params) => {
    console.log(params, 'params')
        // 返回用户列表
    return http.get('/user/getUser', params)
}
export const addUser = (data) => {
    return http.post('/user/add', data)
}

export const editUser = (userId, data) => {
    console.log(userId, 'aaaaaaaaaaaaaa')
    return http.put(`/user/edit/${userId}`, data);
}


export const delUser = (userId, data) => {
    return http.delete(`/user/del/${userId}`, data)
}
export const getMenu = (data) => {
        return http.post('/permission/getMenu', data)
    }
    //get调用/api/pci_hardware/get接口
export const getPci = (data) => {
    return http.get('/pci_hardware/get', data)
}
export const getUsb = (data) => {
    return http.get('/usb_hardware/get', data)
}

export const getToken = (data) => {
    return http.post('/token', data)
}